package net.xgs.rbac.entity.role;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "role_employee_relation", schema = "rbac", catalog = "")
public class RoleEmployeeRelationDto {
    private long id;
    private long employeeId;
    private long roleId;
    private Long orgId;
    private String serverId;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "employee_id")
    public long getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(long employeeId) {
        this.employeeId = employeeId;
    }

    @Basic
    @Column(name = "role_id")
    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "org_id")
    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    @Basic
    @Column(name = "server_id")
    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoleEmployeeRelationDto that = (RoleEmployeeRelationDto) o;
        return id == that.id &&
                employeeId == that.employeeId &&
                roleId == that.roleId &&
                Objects.equals(orgId, that.orgId) &&
                Objects.equals(serverId, that.serverId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, employeeId, roleId, orgId, serverId);
    }
}
